package org.example.demo;

import java.util.Scanner;

/*
 0-100分
* 六个评委 去掉最高分,去掉最低分, 剩下4个平均分是多少? 每个逻辑拆分方法
*
* */
public class Test1 {
    public static void  main(String[] args){
        int[] arr =  getScore();
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        int max =  getMax(arr);
        int min =  getMin(arr);
        int all =  getAll(arr);
        System.out.println((all - max - min) / 4);
    }
    public static int[]  getScore(){
        Scanner sc =  new Scanner(System.in);
        int[] arr = new int[6];
        for (int i = 0; i< arr.length;i++){
            int one =    sc.nextInt();
            if(one >= 0 && one <= 100){
                arr[i] = one;
            }
        }
        return  arr;
    }
    public static int  getMax(int[] arr){
        int i = arr[0];
        for (int i1 = 0; i1 < arr.length; i1++) {
            if(arr[i1] > i){
                i = arr[i1];
            }
        }
        System.out.println(i);

        return  i;
    }
    public static int  getMin(int[] arr){
        int i = arr[0];
        for (int i1 = 0; i1 < arr.length; i1++) {
            if(arr[i1] < i){
                i = arr[i1];
            }
        }
        System.out.println(i);

        return  i;
    }
    public static int  getAll(int[] arr){
        int i = 0;
        for (int i1 = 0; i1 < arr.length; i1++) {
            i+=arr[i1];
        }
        System.out.println(i);

        return  i;
    }

}